//在头顶显示单位名字 和 军衔（颜色为阵营） 本地执行

waitUntil{sleep 10;true};
addMissionEventHandler 
["Draw3D",
	{
		{
		    if((!isNull _x)
			&& {_x distance player < 100}) then 
		    {
				if((vehicle _x == _x)
					|| {_x == effectiveCommander (vehicle _x)})then
				{
					drawIcon3D 
					[
						if(rank _x != "")then{format["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _x]}else{""},
						//Colour
						if(lifeState _x == "INCAPACITATED")then{[ [1,0.9,0.3, 1],[1,0,0,1]]}else{[ [1,0.9,0.3, 1], [1,1,1,1]]},
						//position
						if(((vehicle _x)!=_x)&&(_x==effectiveCommander (vehicle _x))) then {(vehicle _x) modelToWorld [0,0,2.75]}
						else 
						{if((vehicle _x)==_x) then {_x modelToWorld [0,0,2.3]}},
						//width
						1.0,
						//height
						1.0,
						//angle
						0,
						//text
						if(alive _x)then{
							if(lifeState _x == "INCAPACITATED")then{
								format["失血 %1", name _x]
							}else{
								format["%1", name _x]
							};
						}else{""},
						//shadow
					   2,
					   //Text size
					   0.04,
					   //font
					   "PuristaMedium"
					];
				};
		    };
        } forEach allPlayers;
	}
];